import request from '@/router/axios';

// export const getAccountList = (params,page) => {
//   return request({
//     url: '/api/beetles-business/account/openRequirement/page',
//     method: 'get',
//     params:{
//       ...params,
//       ...page,
//     }
//   })
// }
//开户申请列表
export const getAccountList = (params, page) => {
  return request({
    url: '/api/beetles-business/account/openRequirement/pageByTTTwo',
    method: 'get',
    params: {
      ...params,
      ...page,
    }
  })
}
// export const getAccountList = (current,size) => {
//   return request({
//     url: '/api/beetles-business/account/openRequirement/pageByTTTwo',
//     method: 'get',
//     params:{
//       current:1,
//       size:10,
//     }
//   })
// }
//新增
export const save = data => {
  return request({
    url: '/api/beetles-business/account/openRequirement/save',
    method: 'POST',
    data
  })
}
//查看
export const detailAccount = id => {
  return request({
    url: '/api/beetles-business/account/openRequirement/detail',
    method: 'get',
    id
  })
}
//获取编辑数据

//编辑
export const updateAudit = data => {
  return request({
    url: '/api/beetles-business/account/openRequirement/update',
    method: 'post',
    data
  })
}
//更新并提交
export const updateAndAudit = data => {
  return request({
    url: '/api/beetles-business/account/openRequirement/editAndAudit',
    method: 'post',
    data
  })
}
//删除
export const removeAccountByIds = (ids) => {
  return request({
    url: '/api/beetles-business/account/openRequirement/remove',
    method: 'post',
    params: {ids}
  })
}

//审核给代理
export const submitAudit = (id) => {
  return request({
    url: '/api/beetles-business/account/openRequirement/submitAudit',
    method: 'POST',
    params: {id}
  })
}
//保存并提交
export const saveAndAudit = data => {
  return request({
    url: '/api/beetles-business/account/openRequirement/saveAndAudit',
    method: 'POST',
    data
  })
}


//获取产品名
export const getProductName = (appLink) => {
  return request({
    url: '/api/beetles-business/account/openRequirement/getProductNameNew',
    method: 'get',
    params: {
      appLink
    }
  })
}
//获取App信息
export const getAppInfo = (appLink) => {
  return request({
    url: '/api/beetles-business/account/openRequirement/getAppInfo',
    method: 'get',
    params: {
      appLink
    }
  })
}


export const getTimeZone = data => {
  return request({
    url: '/api/blade-system/dict/child-list?current=1&size=200&parentId=1573136552400261122',
    method: 'get',
    data
  })
}

export const getTiktokIndustry = data => {
  return request({
    url: '/api/blade-system/dict/child-list?current=1&size=300&parentId=1573226023112151042',
    method: 'get',
    data
  })
}

export const getCurrency = data => {
  return request({
    url: '/api/blade-system/dict/child-list?current=1&size=300&parentId=1574709532209827842',
    method: 'get',
    data
  })
}


// 获取客户实体列表
export const getAccountEntityList = customerId => {
  return request({
    url: '/api/beetles-business/account/openRequirement/getAccountEntityList',
    method: 'get',
    params: {
      customerId
    }
  })
}

export const getRecordNodeList = accountOpenId => {
  return request({
    url: '/api/beetles-business/account/openRequirement/getAccountOpenStatusList',
    method: 'get',
    params: {
      accountOpenId
    }
  })
}

export const checkLicenseNoExist = (id, licenseNo) => {
  return request({
    url: '/api/beetles-business/account/openRequirement/check-license-no',
    method: 'get',
    params: {
      id,
      licenseNo
    }
  })
}


export const updateEntityName = params => {
  return request({
    url: '/api/beetles-business/account/openRequirement/updateEntityName',
    method: 'POST',
    params,
  })
}

// 获取app详情
export const getOfferDetailById = requirementId => {
  return request({
    url: '/api/beetles-business/account/openRequirement/offer-detail',
    method: 'GET',
    params: {
      requirementId
    }
  })
}

export const getTiktokGeoList = () => {
  return request({
    url: '/api/blade-system/dict-biz/dictionary?code=common_geo',
    method: 'get'
  })
}

export const getBigoGeoList = () => {
  return request({
    url: '/api/blade-system/dict-biz/dictionary?code=bigo_geo',
    method: 'get'
  })
}

export const getKwaiGeoList = () => {
  return request({
    url: '/api/blade-system/dict-biz/dictionary?code=kwai_geo',
    method: 'get'
  })
}

export const getBigoIndustryList = () => {
  return request({
    url: '/api/blade-system/dict-biz/dictionary?code=bigo_industry',
    method: 'get'
  })
}

export const getKwwaiIndustryList = () => {
  return request({
    url: '/api/blade-system/dict-biz/dictionary-tree?code=kwai_industry',
    method: 'get'
  })
}

export const getDeptList = () => {
  return request({
    url: '/api/blade-system/dept/lazy-list',
    method: 'get'
  })
}

// 获取团队
export const getWorkrooms = () => {
  return request({
    url: '/api/blade-system/team/list',
    method: 'get'
  })
}
